<style scoped src="./index.scss" lang="scss" rel="stylesheet/scss"></style>
<template src="./index.html"></template>
<script>
export default {
  mixins: [
    Vue.prototype.$vFN.Mixins.Base,
    Vue.prototype.$vFN.Mixins.Page,
    Vue.prototype.$vFN.Mixins.Table,
  ],
  data() {
    return {
      appWindow: window,
      // 页面接口地址
      apiUrl: {
        list: "mall-site-portal/member-integral-record/list",
      },
      // 列表高级查询参数
      mixinTable_tableSearchSenior: {
        // 手机号
        mobile: {
          type: String,
          value: "",
          default: "",
        },
        // 客户编号
        memberCode: {
          type: String,
          value: "",
          default: "",
        },
        // 变动开始时间
        createdTimeStartStr: {
          type: String,
          value: null,
          default: null,
        },
        // 变动结束时间
        createdTimeEndStr: {
          type: String,
          value: null,
          default: null,
        },
        // 变动类型
        type: {
          type: Number,
          value: null,
          default: null,
        },
      },

      mixinTable_tableSearchData: {
        typeId: "",
        nickName: "",
      },

      assetTypeOptions: [], //资产数组
    };
  },
  methods: {
    // 初始化
    async init() {
      // 数据源 资产类型列表
      this.assetTypeOptions = await this.$vFN.Tools.getSelectListSource(
        {
          url: "mall-site-portal/member-integral-record/getIntegralType",
        },
        window
      );

      this.assetTypeOptions = this.assetTypeOptions.reverse();
      console.log("this.assetTypeOptions", this.assetTypeOptions);

      // 刷新表格数据，此方法扩展时可重写
      this.mixinTable_refreshData();
    },

    // 根据资产id 返回资产名称
    typeId2Text(id_) {
      let text = "";

      this.assetTypeOptions.forEach((item) => {
        if (item.value == id_) {
          text = item.label;
        }
      });

      return text;
    },
  },
  mounted() {
    this.init();
  },
  activated() {},
};
</script>
